package com.zygh.dlqwservice.module.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zygh.dlqwservice.util.DlqwVerificationUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysUser {
    @ApiModelProperty(value = "警员id")
    @TableId(value = "user_id", type = IdType.AUTO)
    private Integer userId;

    @ApiModelProperty(value = "警员名字")
    @NotNull(message = "警员名字不能为空")
    private String name;

    @ApiModelProperty(value = "警号")
    @NotNull(message = "警号不能为空")
    private String warningsignal;

    @ApiModelProperty(value = "部门id")
    @NotNull(message = "部门id不能为空")
    private String deptId;

    @ApiModelProperty(value = "用户名")
    @NotNull(message = "用户名不能为空")
    private String username;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "警务通号")
    @NotNull(message = "警务通号不能为空")
    private String idcard;

    @ApiModelProperty(value = "头像", example = "1")
    private Integer avatarId;

    @ApiModelProperty(value = "手机号")
    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = DlqwVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确")
    private String phone;

    @ApiModelProperty(value = "职务")
    private String dutyCode;

    @ApiModelProperty(value = "警员类型")
    private String type;

    @ApiModelProperty(value = "身份证(可选)")
    private String idcardno;

    @ApiModelProperty(value = "创建日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private String createTime;

    @ApiModelProperty(value = "最后修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private String updateTime;

    @ApiModelProperty(value = "是否删除")
    @NotNull(message = "是否删除不能为空")
    private Byte isDelete;

    @ApiModelProperty(value = "性别")
    @NotNull(message = "性别不能为空")
    private String sex;


}